dnd: Handle rootwin drop in gdk
authorMatthias Clasen <mclasen@redhat.com>
Sun, 3 Dec 2017 05:22:25 +0000 (06:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 3 Dec 2017 05:22:25 +0000 (06:22 +0100)
This lets us drop the only use of the drag protocol in gtk.

gtk/gtkdnd.c

index 848ee5fedca26ab34315229ea03d5729ce7f4e47..b1f2564a14ee1967e71c17cff97bf6e185c0d19c 100644 (file)
@@ -1504,47 +1504,13 @@ static void
 gtk_drag_drop (GtkDragSourceInfo *info, 
                guint32            time)
 {
-  if (gdk_drag_context_get_protocol (info->context) == GDK_DRAG_PROTO_ROOTWIN)
-    {
-      GtkSelectionData selection_data;
-      GdkAtom found = NULL;
-      /* GTK+ traditionally has used application/x-rootwin-drop, but the
-       * XDND spec specifies x-rootwindow-drop.
-       */
-      if (gdk_content_formats_contain_mime_type (info->target_list, "application/x-rootwindow-drop"))
-        found = gdk_atom_intern ("application/x-rootwindow-drop", FALSE);
-      if (gdk_content_formats_contain_mime_type (info->target_list, "application/x-rootwin-drop"))
-        found = gdk_atom_intern ("application/x-rootwin-drop", FALSE);
-      else found = NULL;
-      
-      if (found)
-        {
-          selection_data.selection = NULL;
-          selection_data.target = found;
-          selection_data.data = NULL;
-          selection_data.length = -1;
-
-          g_signal_emit_by_name (info->widget, "drag-data-get",
-                                 info->context, &selection_data,
-                                 time);
+  if (info->icon_window)
+    gtk_widget_hide (info->icon_window);
 
-          /* FIXME: Should we check for length >= 0 here? */
-          gtk_drag_drop_finished (info, GTK_DRAG_RESULT_SUCCESS, time);
-          return;
-        }
-
-      gtk_drag_drop_finished (info, GTK_DRAG_RESULT_NO_TARGET, time);
-    }
-  else
-    {
-      if (info->icon_window)
-        gtk_widget_hide (info->icon_window);
-
-      info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
-                                          gtk_drag_abort_timeout,
-                                          info);
-      g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
-    }
+  info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
+                                                gtk_drag_abort_timeout,
+                                                info);
+  g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
 }
 
 /*